import java.net.InetAddress;

import static sun.rmi.transport.TransportConstants.Ping;

/**
 * Created by Intellij IDEA.
 * User:  xsw
 * Date:  2020/8/6
 */
public class IpConif {
    public static void main(String[] args) throws Exception {
        InetAddress addr = InetAddress.getLocalHost();
        String ip=addr.getHostAddress();//获得本机IP
        System.out.println(ip);
    }
}
